package me.xhy.java.springboot3.webflux.s03exceptionandparam;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
// @RestControllerAdvice = @ControllerAdvice + @ResponseBody
public class S032GlobalExceptionHandler {

  // @ResponseBody
  @ExceptionHandler(value = Exception.class)
  public String mathError(ArithmeticException e) {
    return e.getMessage();
  }


}
